home *** CD-ROM | disk | FTP | other *** search
/ Total Web Page (Professional Suite) / Total Web Page 99.iso / CGI / CONVERT.PL < prev    next >
Perl Script  |  1996-06-03  |  1KB  |  35 lines

  1. #!/usr/local/bin/perl
  2. #
  3. # convert.pl v1.1
  4. # Copyright C - 1995 Jon Wichmann Hansen
  5. # http://www.cbs.dk/people/eclipse/
  6. # wichmann@proventum.dk
  7. #
  8. # Converts a netscape v1.2N bookmark.html file to a file that can be
  9. # read by the rand_link.pl - random link generator by
  10. # Matt Wright. (Thanks to him for that one)
  11. #
  12. # Version 1.1 Enhancements by Matt Wright.
  13. # This script works on version 1.2 - 2.0b1 Netscape versions on either Unix or 
  14. # Mac.  I have neot tested it on the Macintosh, so please inform if it works 
  15. # with a Macintosh bookmark file.  Thanks. - mattw@alpha.pr1.k12.co.us
  16.  
  17. $bookmarks = "./BOOKMARK.HTM";
  18. $rand_file = "./links.txt";
  19.  
  20. open (OUTFILE, ">./$rand_file");  #This is the input-file for rand_link.pl
  21. open (INFILE, "./$bookmarks"); #Change this to be your bookmark-file
  22. while (<INFILE>)
  23. {
  24.   if (/http:/)
  25.   {
  26.     ($adresse, $skodlort)=split(/" ADD_DATE/, $_);
  27.     ($skodlort, $final)=split(/A HREF="/, $adresse);
  28.     print OUTFILE $final,"\n";
  29.   }
  30. }
  31.  
  32. close (FILE);
  33.  
  34. close (OUTFILE);
  35.